import React, { PropsWithChildren } from "react";
import { Outlet } from "react-router";

interface HomePageProps {
  title?: string;
}

const HomePage: React.FC<PropsWithChildren<HomePageProps>> = (
  props: PropsWithChildren<HomePageProps>
) => {
  console.log("Home Page");
  return (
    <>
      <h1>{props.title || "Hello World!"}</h1>
      <div>This is Home Page</div>
      {/* 插槽 */}
      {props.children}
      {/* 子路由 */}
      <Outlet />
    </>
  );
};

export default HomePage;
